package com.ftg.learn.chapter18;

import java.util.function.BiFunction;
import java.util.function.Function;

/**
 * @author KangJx
 * @date 2021/8/26
 */
public class AbcTestClass {

    public String touppper(String str,Abc<String> t){
        return t.getValue(str);
    }

    public String jdkFunction(String str,Function<String,String> t){
        return t.apply(str);
    }

    public Long q3(long l1, long l2, BiFunction<Long, Long,Long> f){
        return f.apply(l1,l2);
    }

    public static void main(String[] args) {
        AbcTestClass atc = new AbcTestClass();
        System.out.println(atc.touppper("AAAAAA",x->x.toLowerCase()));
        System.out.println(atc.jdkFunction("abcdefghij",x->x.substring(1,4)));
        long he = atc.q3(23L,45L,(x,y) -> x+y);
        long ji = atc.q3(23L,45L,(x,y) -> x*y);
        System.out.printf("%d-%d",he,ji);


    }

}
